package ink.lovejinhu.leetcodeMatch;

/**
 * @author jinhu
 * created 2021-08-08 10:31
 */

public class Solution_5838 {
    public boolean isPrefixString(String s, String[] words) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < words.length; i++) {
            String temp = stringBuilder.append(words[i]).toString();
            if (temp.length() > s.length()) {
                return false;
            } else if (temp.length() == s.length()) {
                return temp.equals(s);
            }
        }
        return false;
    }
}
